package org.javaweb.cms_web.model.Enum;

import lombok.Getter;

@Getter
public enum PermissionTypes {
    //团队管理权限
    TEAM_MANAGE(1, "团队管理权限"),
    //科研成果管理与发布权限
    SCIENTIFIC_RESEARCH_MANAGE(2, "科研成果管理与发布权限"),
    //文章管理
    ARTICLE_MANAGE(3, "文章管理"),
    //用户管理
    USER_MANAGE(4, "用户管理"),
    //在线交流与反馈模块
    ONLINE_COMMUNICATION(5, "在线交流与反馈模块"),
    ;

    @Getter
    public final int value;
    public final String name;

    PermissionTypes(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public static PermissionTypes valueOf(int value) {
        for (PermissionTypes permissionTypes : PermissionTypes.values()) {
            if (permissionTypes.value == value) {
                return permissionTypes;
            }
        }
        return null;
    }
}
